import { lazy } from "react";
import {RouterList} from "../utils/index"

export const mainRouter:RouterList = [
    {
        path:"/index/Comprehensive",
        title:"综合",
        element:lazy(() =>import("../pages/Index/Comprehensive")),
    },
    {
        path:"/index/Forut_end",
        title:"前端",
        element:lazy(() =>import("../pages/Index/Frout_end")),
    },
    {
        path:"/index/Back_end",
        title:"后端",
        element:lazy(() =>import("../pages/Index/Back_end")),
    },
    {
        path:"/index/Android",
        title:"Android",
        element:lazy(() =>import("../pages/Index/Android")),
    },
    {
        path:"/index/Ios",
        title:"Ios",
        element:lazy(() =>import("../pages/Index/Ios")),
    },
    {
        path:"/index/Artificial_intelligence",
        title:"人工智能",
        element:lazy(() =>import("../pages/Index/Artificial_intelligence")),
    },
    {
        path:"/index/DevelopmentTools",
        title:"开发工具",
        element:lazy(() =>import("../pages/Index/DevelopmentTools")),
    },
    {
        path:"/index/Reading",
        title:"阅读",
        element:lazy(() =>import("../pages/Index/Reading")),
    }
]

const routes:RouterList = [
    {
        path:"/",
        to:"/index/Comprehensive"
    },
    {
        path:"/index",
        element:lazy(() =>import("../pages/Index")),
        children:mainRouter
    },
    {
        path:"/login",
        element:lazy(() =>import("../pages/Login")),
    },
    {
        path:"/search",
        element:lazy(() =>import("../pages/Search")),
    },
    {
        path:"/details/:id",
        element:lazy(() =>import("../pages/Details")),
    },
    {
        path:"*",
        element:lazy(() =>import("../pages/Eorry404"))
    }
]

export default routes